<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Insert Function </title>
</head>

<body>
/**<br />
* <{$functionName}> ,<{$functionDescription}><br />
* <br />
* @param MySQLi $_dbObject  <br />
  <{foreach from=$insertedColumns item=pa name=foo}>
* @param <{if $pa->singleQuotes=="'"}>string <{else}>int <{/if}><{$pa->updateParamName}><br />
  <{/foreach}>
* @return TRUE means insert successfully, FALSE means error <br />
 */<br />
function <{$functionName}>(MySQLi $_dbObject
<{foreach from =$insertedColumns item=ips name=foo}>,<{$ips->paramName}><{/foreach}>
){<br />
<br />
<br />
  
$sql=sprintf(
  &quot;insert into  &quot;.<{$tableObj->definedTableName}>.&quot;  <{$aliasName}> (
  <{foreach from=$insertedColumns item=att name=foo}>
  <{if $smarty.foreach.foo.index !=0 }>,<{/if}>
  `<{$att->Field}>`
  <{/foreach}>

  <{foreach from=$fixedVG item=att name=foo}>
  <{if $smarty.foreach.foo.index !=0 || count($insertedColumns)>0 }>,<{/if}>
  `<{$att->Field}>`
  <{/foreach}>


 
  )  &quot;.<br />&quot;values(
  <{foreach from=$insertedColumns item=att name=foo}>
  <{if $smarty.foreach.foo.index !=0 }>,<{/if}><{$att->singleQuotes}><{$att->sprintfStr}><{$att->singleQuotes}>
  <{/foreach}>
  
  <{foreach from=$fixedVG item=att name=foo}>
  <{if $smarty.foreach.foo.index !=0 || count($insertedColumns)>0 }>,<{/if}>
  <{$att->fixedValue}>
  <{/foreach}>

  
  )",<br />
  <{foreach from=$insertedColumns item=att name=foo}>
  <{if $smarty.foreach.foo.index !=0 }>,<{/if}>
  <{if $att->escapeStr==1}>$this-&gt;escape_string(<{/if}>
  <{$att->paramName}>
  <{if $att->escapeStr==1}>)<{/if}>
  <{/foreach}>
  

  
);<br />
<br />
  //echo $sql.&quot;&lt;br //&gt;&quot;;<br />
    <br />
  $re=$_dbObject-&gt;query($sql);<br />
  if($re!==FALSE){<br />
<{if ($returnAutoIncreasingIDFlag=="1")}>$this-&gt;<{$autoIncreasingID}>= $_dbObject-&gt;insert_id;<{/if}>
<br />
<{foreach from =$insertedColumns item=ips name=foo}>
$this-&gt;<{$ips->attribute}>=<{$ips->paramName}>;
<br />
<{/foreach}>
<br />
<br />}<br />
<br />
  return $re;<br />
<br />
<br />}<br />



<br />
<br /></body>
</html>
